﻿using Microsoft.AspNetCore.Builder;
using SimpleORM.Infrastructure.Swagger;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleORM.Infrastructure
{
    /// <summary>
    /// 项目中间件
    /// </summary>
    public static class ProgramMiddleware
    {
        public static void UseProgramMiddleware(this IApplicationBuilder app)
        {
            if (app == null) throw new ArgumentNullException(nameof(app));


            app.UseCors("CorsPolocy");


            app.UseAuthorization();
            app.UseRouting();


            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });

            //启用数据签名
            //app.UseRequestValidSign();
        }
    }
}
